FROM node:20.5.0-alpine

RUN apk add --no-cache tini
USER node

WORKDIR /app

COPY --chown=node:node . ./

COPY app.js /app/

RUN yarn --network-timeout=100000
RUN npx prisma generate

EXPOSE 3900

CMD [ "/sbin/tini", "--", "node", "app.js" ]